CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT (SYNCREXT)
SET(LIBSYNCR_SRC sync_cmd.c)
ADD_DEFINITIONS(-g -Wall)

INCLUDE_DIRECTORIES(/usr/local/include /usr/local/openresty/luajit/include/luajit-2.1)
FIND_LIBRARY(LUAJIT_LIBRARY NAMES luajit-5.1
             PATHS /usr/local/openresty/luajit/lib )

ADD_LIBRARY(syncr SHARED ${LIBSYNCR_SRC})
SET_TARGET_PROPERTIES(syncr PROPERTIES VERSION 1.0 SOVERSION 1)

TARGET_LINK_LIBRARIES(syncr ${LUAJIT_LIBRARY})

#INSTALL(TARGETS syncr LIBRARY DESTINATION lib)
INSTALL(TARGETS syncr LIBRARY DESTINATION /usr/local/openresty/lualib)